﻿Ext.define('app.prm.detail.ProgressList', {
    extend: 'Ext.grid.Panel',
    border: true,
    title: localize('ProjectProgress'),
    tools: [{
        type: 'refresh',
        itemId: "refresh",
        handler: function () {
            this.ownerCt.ownerCt.store.reload();
        } //some logic inside handler
    }],
    collapsible: true,
    titleCollapse: false,
   // collapsed: true,
    viewConfig: {
        enableTextSelection: true //可以复制单元格文字
    },
    projectId: 0,
    initComponent: function () {
        var me = this;
        me.store = Ext.create("app.ux.PrmStore", { url: '/api/services/app/project/GetProgressAll', filter: { projectId: me.projectId } });
        me.callParent();
    },
    forceFit: true,
    columns: [
          {
              xtype: 'actioncolumn', bind: {
                  hidden: '{!hasEditProgress}'
              },
              maxWidth: 50, 
              header: localize('Operating'),
              items: [
              {
                  iconCls: 'delete', 
                  handler: 'onDelProgress'
              }]
          },
        { header: localize('RequiredComplete'), maxWidth: 100, dataIndex: 'actualEndTime' },
        { header: localize('ReportDate'), maxWidth: 100, dataIndex: 'reportTime' },
        { header: '客户周报', maxWidth: 100, dataIndex: 'reportWeek', renderer: function (v) { return v>1?'双周报':'单周报' } },
        { header: localize('Status'), maxWidth: 100,  dataIndex: 'status' },
        { header: localize('Description'),  dataIndex: 'note' }
        //{ header: "客户编号", dataIndex: 'customeCode' },
    ]
})